var employeeId;

// @Bind #dgEmployee.onDataRowClick
!function(self, arg) {
	var dsEmployee = view.id("dsEmployee");
	var employee = dsEmployee.getData("#");
	
	employeeId = employee.get("employeeUid");
	
	var dsEmployeeRole = view.id("dsEmployeeRole");
	dsEmployeeRole.set("parameter", employeeId);
	dsEmployeeRole.flush();

	var dsRole = view.id("dsRole");
	dsRole.set("parameter", employeeId);
	dsRole.flush();

}

// @Bind #dgRole.onDataRowClick
!function(self, arg, dsEmployeeRole, dsRole) {
	var employeeRole = dsEmployeeRole.getData("#");
	var role = dsRole.getData("#");
	
	employeeRole.set("roleUid", role.get("uniqueId"));
	employeeRole.set("employeeUid", employeeId);
	employeeRole.set("uniqueId", employeeId + "/" + role.get("uniqueId"));
	employeeRole.set("role.roleName", role.get("roleName"));
	
	dorado.widget.DropDown.findDropDown(self).close();
}

